home *** CD-ROM | disk | FTP | other *** search
/ Crosscountry USA Photo Safari / Crosscountry USA Photo Safari.iso / Data / cc_base / pak00_16bit_f.pk3 / map_actor_city.ac.p < prev    next >
Text File  |  2002-12-18  |  2KB  |  58 lines

  1. {
  2.   ScriptID = Script {
  3.     @draw {
  4.       resid font_id;
  5.       resid map_id;
  6.       int x;
  7.       int y;
  8.       str name;
  9.     
  10.       font_id = ResByName("font/verdana_9_black.tf");
  11.       x = ResPropGetInt(SELF, "ScreenX");
  12.       y = ResPropGetInt(SELF, "ScreenY");
  13.       x += ResPropGetInt(SELF, "text_x");
  14.       y += ResPropGetInt(SELF, "text_y");
  15.       name = ResPropGetStr(SELF, "name");
  16.       DrawTextStr(font_id, x, y, "%s", name);
  17.     }
  18.     @mouseenter {
  19.       ResPropSetResID(SELF, "AnimationID", ResPropGetResID(SELF, "selected_dot"));
  20.     }
  21.     @mouseleave {
  22.       ResPropSetResID(SELF, "AnimationID", ResPropGetResID(SELF, "dot"));
  23.     }
  24.     @activate {
  25.       str   cur_city;
  26.       resid Player;
  27.       resid csv_data_id;
  28.       resid city_data_id;
  29.       resid state_data_id; 
  30.       int   map_view_city_row_num;
  31.       int   map_view_state_row_num;
  32.       
  33.       /* get player information */
  34.       Player = ResPropGetResID(ResByName("Game"),"game_cur_player"); 
  35.       
  36.       Release("laptop");
  37.       Mark("laptop");
  38.            
  39.       cur_city = ResPropGetStr(SELF, "name");
  40.  
  41.       /* get player view city information */
  42.       csv_data_id = ResByName("CSVData");
  43.       city_data_id = ResPropGetResID(csv_data_id, "city_id");
  44.       state_data_id = ResPropGetResID(csv_data_id, "state_id");
  45.       
  46.       map_view_city_row_num = CSVSearch(city_data_id, "name", cur_city);
  47.       ResPropSetInt(Player, "map_view_city_row_num", map_view_city_row_num);
  48.       ResPropSetStr(Player, "map_view_city", cur_city);
  49.       
  50.       map_view_state_row_num = CSVSearch(state_data_id, "abbreviation", CSVGetStr(city_data_id, "state", map_view_city_row_num));
  51.       ResPropSetInt(Player, "map_view_state_row_num", map_view_state_row_num);
  52.       ResPropSetStr(Player, "map_view_state", CSVGetStr(state_data_id, "name", map_view_state_row_num));
  53.  
  54.       ResParseEvent(ResByName("map.gl"), "@updateCityStateViews");
  55.     }
  56.   }
  57. }
  58.